package chen.nf.util.result;

import chen.nf.util.ResultSetHandler;
import chen.nf.util.RowProcessor;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

/**
 * @Author czl
 * @Date 2024-05-10
 *将ResultSet转换为Map
 */
public class MapHandler implements ResultSetHandler<Map<String,Object>> {
    @Override
    public Map<String, Object> handle(ResultSet rs) throws SQLException {
        return rs.next() ? RowProcessor.toMap(rs) : null;
    }
}
